import { reqCategoryList } from '@/api';
import { reqGetBannerList } from '@/api';
//home模块的小仓库
const state = {
  categoryList: [],
  bannerList: []
};
const getters = {};
const mutations = {

  CATEGORYLIST(state, categoryList) {
    state.categoryList = categoryList
  },

  GETBANNERLIST(state, bannerList) {
    state.bannerList = bannerList
  }


};
const actions = {
  async categoryList({ commit }) {
    let result = await reqCategoryList()
    if (result.data.code == 200) {
      commit('CATEGORYLIST', result.data.data)
    }
  },
  async getBannerList({ commit }) {
    let result = await reqGetBannerList()
    if (result.data.code == 200) {
      commit('GETBANNERLIST', result.data.data)
    }
  }
}

export default {

  state,
  getters,
  mutations,
  actions,





}
